﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TierApplication;
public partial class admin_RoleManager_Default : System.Web.UI.Page
{
    P_Role _Role = new P_Role();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            GridViewEx1.OnBind();
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Response.Redirect("AddRole.aspx");
    }
    protected void BindGridViewEx()
    {
        GridViewEx1.DataSource = this._Role.GetRoleAll();
        GridViewEx1.DataBind();
    }
    protected void GridViewEx1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        Response.Redirect("EditRole.aspx?ROLEID=" + this.GridViewEx1.DataKeys[e.NewEditIndex].Value);
    }
    protected void GridViewEx1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        Response.Redirect("GrantMoudle.aspx?ROLEID=" + this.GridViewEx1.DataKeys[e.NewSelectedIndex].Value + "&ROLENAME=" + Server.UrlEncode(this.GridViewEx1.Rows[e.NewSelectedIndex].Cells[1].Text));
    }
    protected void GridViewEx1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        Response.Redirect("GrantPower.aspx?ROLEID=" + this.GridViewEx1.DataKeys[e.RowIndex].Value + "&ROLENAME=" + Server.UrlEncode(this.GridViewEx1.Rows[e.RowIndex].Cells[1].Text));
    }
}